using System;
using System.Collections.Generic;
using System.Reflection;

namespace YDExtendTool.Scripts
{
    public static class ExTool 
    {
        public static List<Type> GetDerivedClassed(this Type type)
        {
            List<Type> derivedClassed = new List<Type>();
            foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
            {
                foreach (Type t in assembly.GetTypes())
                {
                    if (t.IsClass && !t.IsAbstract && type.IsAssignableFrom(t))
                    {
                        derivedClassed.Add(t);
                    }
                }
            }

            return derivedClassed;
        }
    }
}

